package com.sx.fams.task.dao.impl;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.sx.core.BaseDao;
import com.sx.fams.task.dao.ITaskDao;
import com.sx.fams.task.entity.TaskEntity;

public class TaskDao extends BaseDao implements ITaskDao {
	private Log log = LogFactory.getLog(this.getClass());
	
	/* (non-Javadoc)
	 * @see com.sx.fams.task.dao.ITaskDao#queryTaskCounts(com.sx.fams.task.entity.TaskEntity)
	 */
	public String queryTaskCounts(TaskEntity task) {
		// TODO Auto-generated method stub
		String count = null;
		try {
			count = (String)super.getSqlMapClientTemplate().queryForObject("Task.queryTaskCounts",task);
		} catch (Exception e) {
			log.error("获取出访团组数量信息",e);
		}
		return count;
	}

	/* (non-Javadoc)
	 * @see com.sx.fams.task.dao.ITaskDao#queryTaskInfos(com.sx.fams.task.entity.TaskEntity)
	 */
	public List<TaskEntity> queryTaskInfos(TaskEntity task) {
		// TODO Auto-generated method stub
		List<TaskEntity> list = null;
		try {
			list = super.getSqlMapClientTemplate().queryForList("Task.queryTaskInfos",task);
		} catch (Exception e) {
			log.error("获取出访团组信息",e);
		}
		return list;
	}

	public Integer addTaskInfo(TaskEntity task) {
		// TODO Auto-generated method stub
		Integer id = null;
		try {
			id = super.addInfo(task,"Task.insertTask");
		} catch (Exception e) {
			log.error("添加团组信息失败",e);
		}
		return id;
	}

}
